<script id="content" type="text/template">
	
	<!--if{response.user_parent}-->  
	<div class="panel panel-default">
		<div class="panel-body">
			<!--if{response.user_parent.user_logo_image_id}-->
          	<img src="<!--{response.application_config.qiniu_domain+response.user_parent.user_logo_image_id+'?imageView2/1/w/40'}-->" class="img-circle" >
          	<!--/if-->	
          	<div>推荐人ID：<!--{response.user_parent.user_id}--></div>
			<div>推荐人昵称：<!--{response.user_parent.user_nickname}--></div>
			<div>注册时间：<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.user_parent.user_register_time) * 1000)}--></div>
			<div>操作：
			<a href="#/user/user_edit/?id=<!--{response.user_parent.user_id}-->" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</a>
          	<a href="#/user/user_edit/?id=<!--{response.user_parent.user_id}-->&action=user_phone" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span>认证手机</a>
          	<a href="#/user/user_edit/?id=<!--{response.user_parent.user_id}-->&action=user_parent" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span>推荐人</a>
			</div>
		</div>
	</div>
    <!--/if-->
	
	
	<!--<a href="#/user/user_add" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> 添加</a>-->
	<button class="btn btn-success" type="button" action-button="unban"><span class="glyphicon glyphicon-ok-circle"></span> 解封</button>
	<button class="btn btn-danger" type="button" action-button="banned"><span class="glyphicon glyphicon-ban-circle"></span> 封禁</button>
	<!--<button class="btn btn-warning" type="button" action-button="trash"><span class="glyphicon glyphicon-trash"></span> 回收</button>-->
	<button class="btn btn-default search" type="button" ><span class="glyphicon glyphicon-filter"></span> 筛选</button>
	<!--if{http().anchor.query.search}--><span class="label label-default">存在筛选</span><!--/if-->
	<hr/>
	<table class="table table-striped">
      <thead>
        <tr>
          <th><input type="checkbox" action-table="checkbox-all"></th>	
          <th>#</th>
          <th>
          	<!--if{http().anchor.query.sort == "nickname_desc"}-->
          	<a href="javascript:;" action-sort="nickname_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>用户昵称</a>
          	<!--elseif{http().anchor.query.sort == "nickname_asc"}-->
          	<a href="javascript:;" action-sort="nickname_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>用户昵称</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="nickname_desc">用户昵称</a>
          	<!--/if-->
          </th>
          <th>
          	<!--if{http().anchor.query.sort == "phone_verify_count_desc"}-->
          	<a href="javascript:;" action-sort="phone_verify_count_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>认证手机</a>
          	<!--elseif{http().anchor.query.sort == "phone_verify_count_asc"}-->
          	<a href="javascript:;" action-sort="phone_verify_count_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>认证手机</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="phone_verify_count_desc">认证手机</a>
          	<!--/if-->
          	/
          	<!--if{http().anchor.query.sort == "phone_login_count_desc"}-->
          	<a href="javascript:;" action-sort="phone_login_count_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>登录手机</a>
          	<!--elseif{http().anchor.query.sort == "phone_login_count_asc"}-->
          	<a href="javascript:;" action-sort="phone_login_count_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>登录手机</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="phone_login_count_desc">登录手机</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "sex_desc"}-->
          	<a href="javascript:;" action-sort="sex_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>性别</a>
          	<!--elseif{http().anchor.query.sort == "sex_asc"}-->
          	<a href="javascript:;" action-sort="sex_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>性别</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="sex_desc">性别</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "state_desc"}-->
          	<a href="javascript:;" action-sort="state_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>状态</a>
          	<!--elseif{http().anchor.query.sort == "state_asc"}-->
          	<a href="javascript:;" action-sort="state_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>状态</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="state_desc">状态</a>
          	<!--/if-->
          </th>
          
        
          
          <th>
          	<!--if{http().anchor.query.sort == "user_recommend_count_desc"}-->
          	<a href="javascript:;" action-sort="user_recommend_count_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>推广人数</a>
          	<!--elseif{http().anchor.query.sort == "user_recommend_count_asc"}-->
          	<a href="javascript:;" action-sort="user_recommend_count_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>推广人数</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="user_recommend_count_desc">推广人数</a>
          	<!--/if-->
          </th>
          
          <th>
          	<!--if{http().anchor.query.sort == "register_time_desc"}-->
          	<a href="javascript:;" action-sort="register_time_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>注册时间</a>
          	<!--elseif{http().anchor.query.sort == "register_time_asc"}-->
          	<a href="javascript:;" action-sort="register_time_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>注册时间</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="register_time_desc">注册时间</a>
          	<!--/if-->
          </th>
          
          <!--if{response.user_parent}-->  
          <!--else-->
          <th>
          	<!--if{http().anchor.query.sort == "parent_id_desc"}-->
          	<a href="javascript:;" action-sort="parent_id_asc"><span class="glyphicon glyphicon-sort-by-attributes-alt"></span>推荐人</a>
          	<!--elseif{http().anchor.query.sort == "parent_id_asc"}-->
          	<a href="javascript:;" action-sort="parent_id_desc"><span class="glyphicon glyphicon-sort-by-attributes"></span>推荐人</a>
          	<!--else-->
          	<a href="javascript:;" action-sort="parent_id_desc">推荐人</a>
          	<!--/if-->
          </th>
          <!--/if-->
          
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      	<!--if{response.list.data.length}-->
      	<!--for{var i in response.list.data}-->
      	<tr>
          <th><input type="checkbox" action-table="checkbox" data-id="<!--{response.list.data[i].user_id}-->"></th>
          <td><!--{parseInt(i)+1+((parseInt(response.list.page_now) - 1) * response.list.page_size)}--></td>
          <td>
          	<!--if{response.list.data[i].user_logo_image_id}-->
	  		<img src="<!--{response.application_config.qiniu_domain+response.list.data[i].user_logo_image_id+'?imageView2/1/w/40'}-->" class="img-circle">
	  		<!--/if-->
	  		<!--if{response.list.data[i].user_nickname}-->
	        <!--{response.list.data[i].user_nickname}-->
	        <!--else-->
	        <span style="color: #999999;">未设置昵称</span>
	        <!--/if-->
          </td>
          <td style="max-width: 200px;">
          	<div style="max-width: 200px;display: inline-block;">
	          	(<!--if{parseInt(response.list.data[i].user_phone_verify_count)}-->
	          	共有<span style="color: red;"><!--{response.list.data[i].user_phone_verify_count}--></span>个认证
	          	<!--else-->
	          	<span style="color: #999999;">无认证手机</span>
	          	<!--/if-->
	          	<!--if{parseInt(response.list.data[i].user_phone_login_count)}-->
	          	有<span style="color: red;"><!--{response.list.data[i].user_phone_login_count}--></span>个登录设置
	          	<!--else-->
	          	<span style="color: #999999;">无登录设置</span>
	          	<!--/if-->)
	          	
	          	<span style="word-wrap:break-word;display: block;font-weight: bold;">
	          	<!--{response.list.data[i].user_phone_verify_list}-->
	          	</span>
          	</div>
          </td>
          
          <td>
          <!--if{parseInt(response.list.data[i].user_sex) == 1}-->
          <span class="label label-info">男性</span>
          <!--elseif{parseInt(response.list.data[i].user_sex) == 2}-->
          <span class="label label-warning">女性</span>
          <!--else-->
          <span class="label label-default">未知</span>
          <!--/if-->
          </td>
          
          <td>
          <!--if{parseInt(response.list.data[i].user_state)}-->
          <span class="label label-success">正常</span>
          <!--else-->
          <span class="label label-danger">封禁</span>
          <!--/if-->
          </td>
          
          
          <td><!--{response.list.data[i].user_recommend_count}--></td>
          <td><!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.list.data[i].user_register_time) * 1000)}--></td>
          
          <!--if{response.user_parent}-->  
          <!--else-->
						<td style="max-width: 190px;">
						<!--if{response.list.data[i].user_parent_id}-->
								<!--if{response.list.data[i].user_parent_logo_image_id}-->
									<img src="<!--{response.application_config.qiniu_domain+response.list.data[i].user_parent_logo_image_id+'?imageView2/1/w/40'}-->" class="img-circle">
									<!--/if-->
									<!--if{response.list.data[i].user_parent_nickname}-->
									<!--{response.list.data[i].user_parent_nickname}-->
									<!--else-->
									<span style="color: #999999;">未设置昵称</span>
									<!--/if-->

									<!--if{response.list.data[i].user_parent_phone_verify_list}-->
										(<span style="word-wrap:break-word;font-weight: bold;"><!--{response.list.data[i].user_parent_phone_verify_list}--></span>)
									<!--else-->
									<span style="color: #999999;">无认证手机</span>
									<!--/if-->
							<!--else-->
						<span style="color: #999999;">无推荐人</span>
						<!--/if-->
						</td>
          <!--/if-->
          
          
          <td>
          	<a href="#/user/user_edit/?id=<!--{response.list.data[i].user_id}-->" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-edit"></span>编辑</a>
          	<button class="btn btn-default btn-sm user_json" data-id="<!--{response.list.data[i].user_id}-->" type="button">
          		<span class="glyphicon glyphicon-info-sign"></span> 其他信息
          	</button>
          	
          	<a href="#/user/user_list/?search=%257B%2522user_parent_id%2522%253A%2522<!--{response.list.data[i].user_parent_id}-->%2522%257D" class="btn btn-default btn-sm">
	          	<span class="glyphicon glyphicon-filter"></span> 父级推荐
	        </a>
	        <a href="#/user/user_list/?search=%257B%2522user_parent_id%2522%253A%2522<!--{response.list.data[i].user_id}-->%2522%257D" class="btn btn-default btn-sm">
	          	<span class="glyphicon glyphicon-filter"></span> 用户推荐
	        </a>
          </td>
        </tr>
        <!--/for-->
      	<!--else-->
        <tr>
          <td colspan="10" align="center">无数据</td>
        </tr>
        <!--/if-->
      </tbody>
    </table>
    
    
    
    <!--if{response.list.data.length}-->
	<div class="paging" style="text-align: center;">
		<button class="first btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="1" type="button">首页</button>
		<button class="previous btn btn-default <!--if helper{"is_first_page" (response.list.page_now)}-->disabled<!--/if-->" data-page="<!--{parseInt(response.list.page_now) - 1}-->" type="button">上一页</button>
		<button class="btn btn-default" type="button">
			第<!--{response.list.page_now}-->页
			/ 共<!--{response.list.page_count}-->页
			/ 有<!--{response.list.row_count}-->条数据</button>
		<button class="next btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{parseInt(response.list.page_now) + 1}-->">下一页</button>
		<button class="end btn btn-default <!--if helper{"is_end_page" (response.list.page_now, response.list.page_count)}-->disabled<!--/if-->" type="button" data-page="<!--{response.list.page_count}-->">尾页</button>
	</div>
	<div class="form-inline" style="text-align: center;margin-top: 10px;">
		<div class="form-group">
			<input type="text" class="form-control paging--value" placeholder="输入跳转页" style="width: 100px;">
		</div>
		<button type="button" class="btn btn-default paging--submit">跳转</button>
	</div>
	<!--/if-->
	
	
	
	
</script>



<script id="search" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="form-group">
		    <label>用户ID：</label>
		    <input type="text" class="form-control" search placeholder="输入要搜索的用户ID" name="user_id" value="<!--{search.user_id}-->">
		</div>
		<div class="form-group">
		    <label>用户手机号：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的用户手机号" name="user_phone" value="<!--{search.user_phone}-->">
		</div>
		<div class="form-group">
		    <label>用户昵称：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的用户名称" name="user_nickname" value="<!--{search.user_nickname}-->">
		</div>
		
		<div class="form-group">
		    <label>推荐人ID：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的推荐人ID" name="user_parent_id" value="<!--{search.user_parent_id}-->">
		</div>
		<div class="form-group">
		    <label>推荐人手机号：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的推荐人手机号" name="user_parent_phone" value="<!--{search.user_parent_phone}-->">
		</div>
		<div class="form-group">
		    <label>推荐人昵称：</label>
		    <input type="text" class="form-control" placeholder="输入要搜索的推荐人昵称" name="user_parent_nickname" value="<!--{search.user_parent_nickname}-->">
		</div>
		<br/>
		<div class="btn-group" style="width: 100%;">
			<button type="button" class="btn btn-primary" style="width: 50%;" name="search-submit">确定筛选</button>
			<button type="button" class="btn btn-default" style="width: 50%;" name="search-clear">清理筛选</button>
		</div>
	</div>
</script>


<script id="info" type="text/template">
	<div style="padding: 10px;width: 500px;">
		<div class="panel panel-default">
			<div class="panel-body">
				<!--if{user_logo_image_id}-->
	          	<img src="<!--{qiniu_domain+user_logo_image_id+'?imageView2/1/w/40'}-->" class="img-circle" >
	          	<!--/if-->	
	          	<div>用户ID：<!--{user_id}--></div>
				<div>用户昵称：<!--{user_nickname}--></div>
				<div>注册时间：<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(user_register_time) * 1000)}--></div>
				<!--if{user_json.address}-->
				<div>
					<span style="color: #999;">省:</span><!--{user_json.address.province}-->
					<span style="color: #999;">市:</span><!--{user_json.address.city}-->
					<span style="color: #999;">区:</span><!--{user_json.address.area}-->
				</div>
				<!--/if-->
			</div>
		</div>
	</div>
</script>	
	
